/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nominalitzacions.persistance;

import commonlib.domain.ABPair;
import commonlib.persistance.CorpusDataManager;
import java.io.File;
import java.io.IOException;

/**
 *
 * @author marc.mauri
 */
public class VerbCorpusDataManager extends CorpusDataManager {

    /**
     *
     * @param path
     * @throws IOException
     */
    public VerbCorpusDataManager(String path) throws IOException {
        corpusFile = new File(path);
    }

    /**
     *
     * @param pair
     * @return
     */
    @Override
    protected String writeLine(ABPair pair) {
       return pair.getAlpha() + " " + pair.getBeta();
    }

    /**
     *
     * @param line
     * @return
     */
    @Override
    protected ABPair[] readLine(String line) {
        ABPair pairs[] = new ABPair[1];
        String[] pair = line.split(" ");
        pairs[0] = new ABPair(pair[1], pair[0] );
        return pairs;
    }

}
